package net.monare.mifss.admin.ui.wiz.cards;

import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Runo;

public class BaseWizardCard extends VerticalLayout {

	private static final long serialVersionUID = -4491168388958702658L;
	
	private FormLayout formLayout;
	private Label formTile;
	
	public BaseWizardCard(String cardTitle, String cardId) {

		setId(cardId);

		setSpacing(true);
		setMargin(true);
		
		formLayout = new FormLayout();
		formLayout.setSpacing(true);
		formLayout.setMargin(true);

		// set form title
		formTile = new Label(cardTitle);
		formTile.setStyleName(Runo.LABEL_H2);

		// pack components
		addComponent(new Label("<hr/>", ContentMode.HTML));
		addComponent(formTile);
		setComponentAlignment(formTile, Alignment.TOP_LEFT);
		addComponent(formLayout);
		setComponentAlignment(formLayout, Alignment.TOP_LEFT);

	}

	protected void addFormComponent(Component component) {
		formLayout.addComponent(component);
	}

}